#ifndef DRAWINGTYPE_H
#define DRAWINGTYPE_H

/*!
 * \file objdrawbehaviour.h
 * \brief Header of classes CDrawingType, CDrawingRegular, CDrawingWireFrame, CDrawingTypeVBO, CDrawingTypeVBORegular and CDrawingTypeVBOWireFrame
 * \author Benjamin Toueg
 * \version 26.05.09
 */

#include <GL/glew.h>

class CMeshObj;

namespace ogl
{

class CDrawingType
{
public:
    enum eBehaviour
    {
        REGULAR,
        WIREFRAME,
        REGULAR_VBO,
        WIREFRAME_VBO
    };

    CDrawingType() {}
    virtual ~CDrawingType() {}
    virtual void draw(const CMeshObj& mesh) = 0;
    virtual eBehaviour myBehaviour() = 0;
};

class CDrawingRegular: public virtual CDrawingType
{
public:
    CDrawingRegular() {}
    virtual ~CDrawingRegular() {}
    void draw(const CMeshObj& mesh);
    eBehaviour myBehaviour() { return REGULAR; };
};

class CDrawingWireFrame: public virtual CDrawingType
{
public:
    CDrawingWireFrame() {}
    virtual ~CDrawingWireFrame() {}
    void draw(const CMeshObj& mesh);
    eBehaviour myBehaviour() { return WIREFRAME; };
};

class CDrawingTypeVBO: public virtual CDrawingType
{
public:
    CDrawingTypeVBO(const CMeshObj& mesh);
    virtual ~CDrawingTypeVBO();
    virtual void draw(const CMeshObj& mesh) = 0;
    virtual eBehaviour myBehaviour() = 0;
protected:
    GLuint m_uiBuffer;
};

class CDrawingRegularVBO: public virtual CDrawingTypeVBO
{
public:
    CDrawingRegularVBO(const CMeshObj& mesh):CDrawingTypeVBO(mesh) {}
    virtual ~CDrawingRegularVBO() {}
    void draw(const CMeshObj& mesh);
    eBehaviour myBehaviour() { return REGULAR_VBO; };
};

class CDrawingWireFrameVBO: public virtual CDrawingTypeVBO
{
public:
    CDrawingWireFrameVBO(const CMeshObj& mesh):CDrawingTypeVBO(mesh) {}
    virtual ~CDrawingWireFrameVBO() {}
    void draw(const CMeshObj& mesh);
    eBehaviour myBehaviour() { return WIREFRAME_VBO; };
};

}

#endif // DRAWINGTYPE_H
